<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="com.jiadakeji.ppm.modules.sys.utils.*" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>报修管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
        $(document).ready(function() {
            //$("#name").focus();
            $("#inputForm").validate({
                submitHandler: function(form){
                    loading('正在提交，请稍等...');
                    form.submit();
                },
                errorContainer: "#messageBox",
                errorPlacement: function(error, element) {
                    $("#messageBox").text("输入有误，请先更正。");
                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                }
            });
        });
	</script>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content  animated fadeInRight">
	<div class="col-sm-12">
	<sys:message content="${message}"/>
		<div class="tabs-container ">
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/business/feeMonth/preInit/">月份初始化</a></li>
		<li><a href="${ctx}/business/feeMonth/">月份列表</a></li>
	</ul>
			<div id="tab-1" class="tab-pane active">
				<div class="panel-body boxPanel">
						<%--<form:form id="inputForm" modelAttribute="user" action="${ctx}/sys/user/info" method="post" class="form-horizontal">
							<sys:message content="${message}"/>--%>
				<form:form id="inputForm" modelAttribute="monthInitDTO"  action="${ctx}/business/feeMonth/init" method="post" class="form-horizontal">
				<div class="boxHeight">
		<%-- 第一次初始化，没有前一个月份--%>
		<c:if test="${not empty monthInitDTO.currentId }" >
					<form:hidden path="currentId"/>
					<input type="hidden" name="monthInitDTO.currentId"  VALUE="${monthInitDTO.currentId}">
					<div class="control-group">
						<label class="control-label">当前月份：</label>
						<div class="controls">
					<input name="currentMonth" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
						   value="<fmt:formatDate value="${monthInitDTO.currentMonth}" pattern="yyyy-MM"/>"
					/>
					<span class="help-inline"><font color="red">*</font> </span>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">起始日：</label>
				<div class="controls">
					<input name="startDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
						   value="<fmt:formatDate value="${monthInitDTO.startDate}" pattern="yyyy-MM-dd"/>"
					/>
				</div>
			</div>

			<div class="control-group">
				<label class="control-label">终止日：</label>
				<div class="controls">
					<input name="endDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
						   value="<fmt:formatDate value="${monthInitDTO.endDate}" pattern="yyyy-MM-dd"/>"
					/>
				</div>
			</div>
		</c:if>

		<div class="control-group">
			<label class="control-label">初始化月份：</label>
			<div class="controls">
				<input name="initCurrentMonth" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required "
					value="<fmt:formatDate value="${monthInitDTO.initCurrentMonth}" pattern="yyyy-MM"/>"
					/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">初始化起始日：</label>
			<div class="controls">
				<input name="initStartDay" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
					value="<fmt:formatDate value="${monthInitDTO.initStartDay}" pattern="yyyy-MM-dd"/>"
					/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">初始化终止日：</label>
			<div class="controls">
				<input name="initEndDay" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
					value="<fmt:formatDate value="${monthInitDTO.initEndDay}" pattern="yyyy-MM-dd"/>"
					/>
			</div>
		</div>
	</div>

	<div class="form-actions">
		<shiro:hasPermission name="business:feeMonth:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
	</div>
	</form:form>
     </div>
</div>
</div>
		</div>
	</div>
</body>
</html>